package org.cloud.ext.mq.common;

/**
 * 消息类型
 * @author xukk
 * @date 2020/3/10
 */
public enum PushWayEnum {
    /**
     * web
     */
    WEB("WEB_"),
    /**
     * app
     */
    APP("APP_"),
    /**
     * 未知
     */
    UNKNOWN("UNKNOWN_");

    private String code;

    PushWayEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static PushWayEnum convert(String type){
        for (PushWayEnum pushWayEnum : values()) {
            if(pushWayEnum.name().equalsIgnoreCase(type)){
                return pushWayEnum;
            }
        }
        return PushWayEnum.UNKNOWN;

    }
}
